package com.task.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.entity.TaskRecord;
import com.task.entity.JsonTaskRecord;
import com.task.service.TaskRecordService;
import com.utils.JsonResult;

/**   
* @Title: TaskRecordController.java 
* @Package com.task.controller 
* @author 孙梦楠 
* @date 2017年9月6日 下午4:52:32 
* @version V1.0.0   
*/
@RestController
@RequestMapping(value = "/task_record")
public class TaskRecordController {
	
	@Autowired
	private TaskRecordService taskrecordservice;
	
	@RequestMapping(value = "", method = RequestMethod.POST)
	public JsonResult<List<JsonTaskRecord>> listrecord(@RequestBody  JsonTaskRecord JsonTaskRecord,
			@CookieValue(value = "opeorgcookie", required = false) String opeorgcookie,
			@CookieValue(value = "opetypecookie", required = false) String opetypecookie){
		
		Integer taskid=JsonTaskRecord.getTaskid();
		String time=JsonTaskRecord.getTime();
		String begintime=JsonTaskRecord.getBegintime();
		String endtime=JsonTaskRecord.getEndtime();
		Integer taskorg = Integer.valueOf(opeorgcookie);
		
		return taskrecordservice.listRecord(taskid, time, begintime, endtime, taskorg, opetypecookie);
	}
	
	

}
